package com.tongna.crawler;

import com.tongna.crawler.data.apis.Apis;
import com.tongna.crawler.data.utils.RpcUtils;
import com.tongna.crawler.data.vo.AbstractVo;
import com.tongna.crawler.data.vo.WebSiteVo;
import com.tongna.crawler.demo.BidCrawler;

import java.io.IOException;

public class Apps {
    public Apps() {
    }

    public static void main(String[] args) {
        try {
            Apis api = (Apis) RpcUtils.get(Apis.class);
            String url = "1";
            String title = "2";
            String author = "3";
            AbstractVo vo = (AbstractVo)api.add(url, title, author, 1L).execute().body();
            System.out.println(vo.getMsg());
            WebSiteVo vov = (WebSiteVo)api.finbyid(1L).execute().body();
            System.out.println(vov);
        } catch (IOException var7) {
            var7.printStackTrace();
        }

    }

    public static void start(Long id) {
        Apis api = (Apis)RpcUtils.get(Apis.class);

        try {
            WebSiteVo vo = (WebSiteVo)api.finbyid(id).execute().body();
            BidCrawler.start(vo);
            System.out.println("开始抓起数据!.........................");
        } catch (IOException var3) {
            var3.printStackTrace();
        }

    }
}
